package com.tricode.ile.training.task.one.generaterandomstring;

import java.util.Random;

public class GenerateRandomString {

	/**
	 * 
	 * @returns random string from 5 characters all in lower case letters
 	 */
	public String makeRandomString(int lengthParameter) {
		Random random = new Random();
		char nextChar;
		StringBuilder sb = new StringBuilder();

		for (int i = 0; i < lengthParameter; i++) {
			// random.nextInt(26) + 97 is for lower case letters
			nextChar = (char) (random.nextInt(26) + 97);
			sb.append(nextChar);
		}

		return sb.toString();
	}

}
